<template>
    <section>
         <div class="section-content clearfix">
             <!--列表-->
            <el-table :data="slavelist" highlight-current-row v-loading="listLoading" @selection-change="selsChange" style="width: 100%;">
                <!-- <el-table-column type="selection">
                </el-table-column> -->
                <el-table-column type="index" label="序号"  width="80":index="indexMethod">
                </el-table-column>
                <el-table-column prop="name" label="名称">
                </el-table-column>
                <!-- <el-table-column prop="lastLoginTime" label="时间">
                </el-table-column> -->
                <el-table-column prop="slaveSn" label="从机号">
                </el-table-column>
                <el-table-column prop="deviceDataRecipeName" label="显示模板名称">
                </el-table-column>
                <el-table-column prop="softVersion" label="软件版本">
                </el-table-column>
                <el-table-column prop="softCode" label="软件编码">
                </el-table-column>
                <el-table-column prop="paramsVersion" label="参数版本">
                </el-table-column>
                <el-table-column prop="paramsCode" label="参数编码">    
                </el-table-column>
                <el-table-column prop="process" label="显示进度">
                    <template scope="scope">
                        <el-progress :text-inside="true" :stroke-width="18" style="color: greenyellow"
                            :percentage="scope.row.process"></el-progress>
                    </template>
                </el-table-column>
                <!-- <el-table-column prop="companyLevel" label="职务">
                </!--> -->
                <el-table-column label="当前状态">
                    <template scope="scope">
                        <span v-if="scope.row.state==0">离线</span>
                        <span v-if="scope.row.state==1">在线</span>
                    </template>
                </el-table-column>
            </el-table>
         </div>
    </section>
</template>

<script>
import {
    device_slave_list
}from "../../../api/api"
export default{
        data(){
            return{
               slavelist:[],
               sels:'',
               listLoading:false,
               page:1,
               pageSize:10
            } 
        },
        methods:{
            getEquipment(){
                let para = {
                    deviceId:sessionStorage.getItem("equipment_deviceId")
                }
                device_slave_list(para).then((res) => {
                    console.log(res)
                    this.slavelist = res.data.list
                })
            },
            selsChange: function (sels) {
                this.sels = sels;
            },
            indexMethod(index) {
                console.log(this.page)
                let num = (this.page - 1) * this.pageSize + index + 1;
                return num;
            },
        },
        mounted(){
            this.getEquipment()
        }
    }
</script>